home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / hplip / ui4 / nodevicesdialog.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2009-10-28  |  2KB  |  51 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from base.g import *
  5. from base import device, utils
  6. from ui_utils import *
  7. from PyQt4.QtCore import *
  8. from PyQt4.QtGui import *
  9. from nodevicesdialog_base import Ui_NoDevicesDialog_base
  10.  
  11. class NoDevicesDialog(QDialog, Ui_NoDevicesDialog_base):
  12.     
  13.     def __init__(self, parent):
  14.         QDialog.__init__(self, parent)
  15.         self.setupUi(self)
  16.         self.initUi()
  17.  
  18.     
  19.     def initUi(self):
  20.         self.connect(self.SetupButton, SIGNAL('clicked()'), self.SetupButton_clicked)
  21.         self.connect(self.CUPSButton, SIGNAL('clicked()'), self.CUPSButton_clicked)
  22.         self.connect(self.CloseButton, SIGNAL('clicked()'), self.CloseButton_clicked)
  23.         self.Icon.setPixmap(load_pixmap('warning', '32x32'))
  24.  
  25.     
  26.     def SetupButton_clicked(self):
  27.         self.close()
  28.         if utils.which('hp-setup'):
  29.             cmd = 'hp-setup -u'
  30.         else:
  31.             cmd = 'python ./setup.py -u'
  32.         log.debug(cmd)
  33.         utils.run(cmd, log_output = True, password_func = None, timeout = 1)
  34.         
  35.         try:
  36.             self.parent().rescanDevices()
  37.         except Error:
  38.             QMessageBox.critical(self, self.windowTitle(), self._NoDevicesDialog__tr('<b>An error occurred.</b><p>Please re-start the Device Manager and try again.'), QMessageBox.Ok, QMessageBox.NoButton, QMessageBox.NoButton)
  39.  
  40.  
  41.     
  42.     def CUPSButton_clicked(self):
  43.         self.close()
  44.         utils.openURL('http://localhost:631/admin?op=add-printer')
  45.  
  46.     
  47.     def CloseButton_clicked(self):
  48.         self.close()
  49.  
  50.  
  51.